ProcessHrtime   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 12
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A diff 0 6 1
A bench 0 3 1
1
import { NS_PER_MS } from 'myrmidon';
2
import Timer from './Timer';
3
4
export default class ProcessHrtime extends Timer {
5
    bench() {
6
        return process.hrtime.bigint();
7
    }
8
9
    diff(start, end) {
10
        const nsDiff = end - start;
11
        const msTime = nsDiff  / BigInt(NS_PER_MS);
12
13
        return Number(msTime);
14
    }
15
}
16